2026-09-20 · powershell, class-notes
PowerShell has thousands of commands, and every module you install adds more. No one memorises them. Skilled PowerShell users are skilled at finding and reading help. The book is emphatic on this point: if you learn…
Class notes · Learn PowerShell in a Month of Lunches (Jeffery Hicks et al.) · Chapter 3
Quick reference: the short version of this chapter is the Chapter 3 cheat sheet.
By the end of these notes you should be able to:
PowerShell has thousands of commands, and every module you install adds more. No one memorises them. Skilled PowerShell users are skilled at finding and reading help. The book is emphatic on this point: if you learn to use help well, you can teach yourself any command — including ones that don't exist yet.
The help system answers three questions:
PowerShell ships with only minimal help. Full help — descriptions, parameter details, examples and the about_ topics — is downloaded separately, so Microsoft can fix and improve it without shipping a new PowerShell. On a fresh install, Get-Help shows little more than the syntax, and may prompt you to update.
Command
Does
Update-Help
Downloads the latest help for installed modules
Update-Help -Scope CurrentUser
Installs help for your account only — no admin rights needed. This is the default in PowerShell 7
Update-Help -Scope AllUsers
Installs for everyone — needs an elevated session
Update-Help -UICulture en-US
Asks for English help. Useful if help for your system language isn't published
Save-Help -DestinationPath
Downloads help files to a folder
Update-Help -SourcePath
Installs help from that folder — for machines without internet access
In the real world: servers often have no internet access. Run Save-Help on a connected machine, copy the folder across, then Update-Help -SourcePath on the server.
Both Get-Help and Get-Command accept wildcards (* = any characters):
Get-Help *event* \
Get-Command *item* \
Get-Command -Noun Process \
Get-Command -Verb Get -Noun *Net* \
Get-Command -Module Microsoft.PowerShell.Management
help is a built-in function that runs Get-Help and pages the output one screen at a time. Use help interactively; use Get-Help in scripts.
PS> Get-Command -Noun Process
CommandType Name
Cmdlet Debug-Process
Cmdlet Get-Process
Cmdlet Start-Process
Cmdlet Stop-Process
Cmdlet Switch-Process
Cmdlet Wait-Process1. __Pick the verb:__ Stop-Process is the obvious candidate.
This verb–noun reasoning works because PowerShell commands follow a consistent Verb-Noun naming convention (chapter 4). Guess the noun, then look at the verbs.
You search Get-Command *eventlog* on PowerShell 7 and get nothing.
Lesson: when a search finds nothing, try a shorter or different keyword before concluding the command doesn't exist. Remember that some commands are Windows-only or 5.1-only.
Many commands can be used in more than one way. Each way is a parameter set, shown as a separate syntax block. You can use parameters from one set at a time.
PS> Get-Command Stop-Process -Syntax
Stop-Process [-Id] <int[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [
Stop-Process -Name <string[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [
Stop-Process [-InputObject] <Process[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [
Syntax pattern
Meaning
Example
-Name <string[]> (no brackets)
Mandatory parameter. You must type the name -Name
Stop-Process -Name notepad
[-Id] <int[]>
Mandatory, positional. The value is required; typing -Id is optional
Stop-Process 1234
[[-Path] <string[]>]
Optional, positional. The whole parameter can be left out; if used, its name is optional
Get-ChildItem C:\Temp
[-Force]
Switch. No value — including it turns the behaviour on
Stop-Process -Name notepad -Force
[-Filter
Optional, named. You must type the name if you use it
-Filter *.log
[
Parameters every cmdlet shares, such as -Verbose and -ErrorAction
See about_CommonParameters
Value types appear in angle brackets:
Type
Accepts
Text
A whole number
<string[]> or <int[]>
One or more values — the [] means an array. Separate values with commas: -Name notepad, calc
<Process[]>
One or more process objects
On or off
Get-ChildItem [[-Path] <string[]>] [[-Filter]
Get-ChildItem -Path C:\Logs -Filter *.log Get-ChildItem C:\Logs *.log- PowerShell assigns the unnamed values to positions 1 and 2 — Path, then Filter.
Command
Shows
Get-Help Stop-Process
Summary: synopsis, syntax, short description
Get-Help Stop-Process -Examples
Only the examples — often the fastest route to an answer
Get-Help Stop-Process -Detailed
Parameter descriptions plus examples
Get-Help Stop-Process -Full
Everything, including technical details for each parameter
Get-Help Stop-Process -Parameter Name
Details for one parameter
Get-Help Stop-Process -Online
Opens the latest version on Microsoft's website in your browser
Get-Help Stop-Process -ShowWindow
Help in a separate, searchable window (Windows only)
PS> Get-Help Get-Process -Parameter Name
-Name <string[]> Required? false Position? 0 Accept pipeline input? true (ByPropertyName) Parameter set name Name, NameWithUserName Aliases ProcessName Dynamic? false Accept wildcard characters? false
Field
Tells you
Required?
Whether it's mandatory — in this parameter set
Position?
Its positional order (numbering starts at 0 in current help), or "named" if it can't be used positionally
Accept pipeline input?
Whether it can take values from the pipeline, and how — important in later chapters
Aliases
Alternative, shorter names for the parameter
Accept wildcard characters?
Whether * and ? work in its value — check against the full help and examples
Help can be incomplete when it isn't updated. Some of these fields are generated automatically and may be less accurate until you run Update-Help. If a detail matters, check the -Online version.
Commands aren't the only thing with help. PowerShell concepts are documented in about topics:
Get-Help about_* \
Get-Help about_CommonParameters \
Get-Help about_Wildcards Get-Help about_Execution_Policies Get-Help about_AliasesWhen a chapter introduces a concept, reading the matching about_ topic is a good way to deepen it. The book regularly points you to them.
Task: list only the files (not folders) in a directory, including hidden ones, without searching online.
Get-ChildItem -Path C:\Temp -File -Force1. Test it, and compare with and without -Force.
Every step used help. This is the pattern for learning any new command.
Stop-Process -Name notepad -WhatIf \
Term
Definition
Updatable help
Help content downloaded separately from PowerShell and refreshed with Update-Help
Update-Help
Downloads and installs the latest help
Save-Help
Saves help files to a folder for offline installation
Get-Help / help
Displays help / the same, one page at a time
Get-Command
Lists commands, filterable by name, verb, noun or module
Wildcard
* or ? used to match names
Syntax
The formal description of how to use a command
Parameter set
One valid combination of a command's parameters
Mandatory parameter
A parameter that must be supplied
Positional parameter
A parameter whose value can be given without its name, by position
Named parameter
A parameter that must be written with its name
Switch parameter
A parameter with no value, turned on by being present
Array ([])
One or more values, separated by commas
Common parameters
Parameters every cmdlet supports, such as -Verbose and -ErrorAction
about_ topic
Help documenting a PowerShell concept rather than a command
-WhatIf
Shows what a command would do without doing it
-Confirm
Prompts for confirmation before making a change